import { fromJS } from 'immutable';
import { constants } from '../store';

const defaultState = fromJS({
  title: "",
  content: ""
})

const detailReducer = (state=defaultState, action) => {
  switch (action.type) {
    case constants.GET_ARTICLE_CONTENT:
      return state.merge({
        title: fromJS(action.title),
        content: fromJS(action.content),
      })
    default :
      return state
  }
};

export default detailReducer
